#ifndef CENGINE_H__
#define CENGINE_H__

#include <d3d9.h>
#include <d3dx9.h>

#include "CCore.h"
#include "CInput.h"
#include "CRenderer.h"
#include "..\\Content\\CContentHandler.h"
#include "..\\Content\\CTerrain.h"
#include "..\\Content\\CWorld.h"
#include <boost/thread.hpp>
#include <boost/function.hpp>



namespace GameCore
{
class CEngine
{
public:
	CEngine(D3DPRESENT_PARAMETERS, const HINSTANCE);
	~CEngine(){delete GameCore::CCore::getCore(); delete pRenderer;};
	void init(void);
	void run(void);
	void clean(void);



private:
  void update(void);
	void onLostDevice(void);
	void onResetDevice(void);
	void setLight(void);
	void checkDevice(void);
	D3DPRESENT_PARAMETERS d3dpp;

	int li;
	bool up;
	
	Content::CContentHandler* pContentHandler;
	GameCore::CCamera* pCamera;
	GameCore::CInput* pInput;
	GameCore::CRenderer* pRenderer;
	LPDIRECT3DDEVICE9 pD3DDevice;
	bool deviceLostFlag;
	Content::CWorld* pWorld;

protected:
};
}//namespace GameCore

#endif